package lab02.test26;

import java.util.Scanner;

public class ExceptionTest {
    public static void main(String[] args) {
        {


            try  {
                Scanner sc = new Scanner(System.in);

                System.out.println("输入一个数：");
                int a = sc.nextInt();
                int b = a / 0;

            } catch (ArithmeticException e) {
                System.out.println("除数为零");
                e.printStackTrace();

            } finally {
                System.out.println("有异常");
            }
        }
    }
}
